package DBHelper;

import com.sun.org.apache.regexp.internal.REUtil;

import java.sql.*;

/**
 * @description: database operation tool
 * @author: XuYuanjun
 * @create: 2020-03-25 22:08
 **/
public class DBUtils {
    public static DBUtils getInstance() {
        if (instance == null) {
            instance = new DBUtils();
        }
        return instance;
    }
    private static DBUtils instance;

    public Connection getConnection() {
        try {
            connection = DriverManager.getConnection(DBSetting.JDBC_DRIVER, DBSetting.USER, DBSetting.Password);
        }
        catch (SQLException e){
            connection = null;
        }
        return connection;
    }
    private Connection connection;

    public ActionResult Addrecord(){
        // todo...
        return new ActionResult(true,"执行成功",null);
    }
}

